package com.oocl.euc.core.maintenance.model;

import com.oocl.euc.audit.AuditEntity;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "PCRS_TEAM_LIST")
@SequenceGenerator(name = "SEQUENCE_GENERATOR", sequenceName = "TEAM_LIST_SEQUENCE", allocationSize = 1)
public class Team extends AuditEntity {
    @Column(name = "TEAM_NAME")
    private String name;

    @Column(name = "TEAM_DESC")
    private String desc;

    @OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER, orphanRemoval = true)
    @JoinColumn(name = "TEAM_ID", referencedColumnName = "ID")
    private List<TeamEndorser> teamEndorsers;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public List<TeamEndorser> getTeamEndorsers() {
        return teamEndorsers;
    }

    public void setTeamEndorsers(List<TeamEndorser> teamEndorsers) {
        this.teamEndorsers = teamEndorsers;
    }
}
